package coder.taiji.test.springnetty.udp.dto;

import java.net.InetSocketAddress;

/**
 * Listing 13.1 LogEvent message
 *
 * @author <a href="mailto:norman.maurer@gmail.com">Norman Maurer</a>
 */
public final class LogEvent extends BaseUdpInfo {
	public static final byte SEPARATOR = (byte) ':';
	private String logfile;
	private String msg;


	public LogEvent(InetSocketAddress source, long recvTime,
	                String logfile, String msg) {
		setSource(source);
		this.logfile = logfile;
		this.msg = msg;
		setRecvTime(recvTime);
	}

	public LogEvent(InetSocketAddress source, long recvTime) {
		setSource(source);
		setRecvTime(recvTime);
	}

	public void setLogfile(String logfile) {
		this.logfile = logfile;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}


	public String getLogfile() {
		return logfile;
	}

	public String getMsg() {
		return msg;
	}


	@Override
	public String toString() {
		return "LogEvent{" +
				"logfile='" + logfile + '\'' +
				", msg='" + msg + '\'' +
				"} " + super.toString();
	}
}
